package com.credit.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.common.ServerResponse;
import com.credit.mapper.debtRiskMapper;
import com.credit.mapper.economicGainMapper;
import com.credit.mapper.furtherInformationMapper;
import com.credit.mapper.industryMapper;
import com.credit.mapper.profitabilityMapper;
import com.credit.mapper.qualityAssetsMapper;
import com.credit.pojo.debtRisk;
import com.credit.pojo.economicGain;
import com.credit.pojo.furtherInformation;
import com.credit.pojo.industry;
import com.credit.pojo.profitability;
import com.credit.pojo.qualityAssets;
import com.credit.service.IIndustryService;
import com.credit.vo.RateVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class IndustryServiceImpl implements IIndustryService{

	@Autowired
	private industryMapper industryMapper;
	
	@Autowired
	private profitabilityMapper profitabilityMapper;
	
	@Autowired
	private qualityAssetsMapper qualityAssetsMapper;
	
	@Autowired
	private debtRiskMapper debtRiskMapper;
	
	@Autowired
	private economicGainMapper economicGainMapper;
	
	@Autowired
	private furtherInformationMapper furtherInformationMapper;
	

	public ServerResponse selectIndustry(industry i, int pageNum, int pageSize) {
		if(i.getPid()==null) {
			i.setPid(0);
		}
		PageHelper.startPage(pageNum, pageSize);
		 
		 List<industry> list=industryMapper.selectIndustry(i);
		 
		 PageInfo pageInfo = new PageInfo(list);
		
		 return ServerResponse.createBySuccess(pageInfo);
	}

	public ServerResponse updateIndustry(industry record) {
		
		return ServerResponse.createBySuccess(industryMapper.updateIndustry(record));
	}

	public ServerResponse insertIndustry(industry record) {
		
		return ServerResponse.createBySuccess(industryMapper.insertIndustry(record));
	}

	public ServerResponse deleteIndustry(Integer id) {
	
		return ServerResponse.createBySuccess(industryMapper.deleteIndustry(id));
	}

	public ServerResponse selectByIndustry(Integer id) {
		
		return ServerResponse.createBySuccess(industryMapper.selectByIndustry(id));
	}

	
	
	
	
	
	
	
	public ServerResponse deleteProfitability(Integer id) {
		
		return ServerResponse.createBySuccess(profitabilityMapper.deleteProfitability(id));
	}

	public ServerResponse insertProfitability(profitability record) {
		
		return ServerResponse.createBySuccess(profitabilityMapper.insertProfitability(record));
	}

	public ServerResponse updateProfitability(profitability record) {
		
		return ServerResponse.createBySuccess(profitabilityMapper.updateProfitability(record));
	}

	public profitability selectProfitability(RateVo p) {
		
		return profitabilityMapper.selectProfitability(p);
	}

	public ServerResponse selectProfitabilityKey(Integer id) {
		
		return ServerResponse.createBySuccess(profitabilityMapper.selectProfitabilityKey(id));
	}

	
	
	
	
	
	
	
	public ServerResponse deleteQualityAssets(Integer id) {
		
		return ServerResponse.createBySuccess(qualityAssetsMapper.deleteQualityAssets(id));
	}

	public ServerResponse insertQualityAssets(qualityAssets record) {
		
		return ServerResponse.createBySuccess(qualityAssetsMapper.insertQualityAssets(record));
	}

	public ServerResponse updateQualityAssets(qualityAssets record) {
		
		return ServerResponse.createBySuccess(qualityAssetsMapper.updateQualityAssets(record));
	}

	public qualityAssets selectQualityAssets(RateVo q) {
		
		return qualityAssetsMapper.selectQualityAssets(q);
	}

	public ServerResponse selectQualityAssetsKey(Integer id) {
		
		return ServerResponse.createBySuccess(qualityAssetsMapper.selectQualityAssetsKey(id));
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	public ServerResponse deleteDebtRisk(Integer id) {
		
		return ServerResponse.createBySuccess(debtRiskMapper.deleteDebtRisk(id));
	}

	public ServerResponse insertDebtRisk(debtRisk record) {
		
		return ServerResponse.createBySuccess(debtRiskMapper.insertDebtRisk(record));
	}

	public ServerResponse selectDebtRiskKey(Integer id) {
		
		return ServerResponse.createBySuccess(debtRiskMapper.selectDebtRiskKey(id));
	}

	public ServerResponse updateDebtRisk(debtRisk record) {
		
		return ServerResponse.createBySuccess(debtRiskMapper.updateDebtRisk(record));
	}

	public debtRisk selectDebtRisk(RateVo d) {
		
		return debtRiskMapper.selectDebtRisk(d);
	}

	
	
	
	
	
	
	
	
	
	
	

    public ServerResponse deleteEconomicGain(Integer id) {
		
		return ServerResponse.createBySuccess(economicGainMapper.deleteEconomicGain(id));
	}

	public ServerResponse insertEconomicGain(economicGain record) {
		
		return ServerResponse.createBySuccess(economicGainMapper.insertEconomicGain(record));
	}

	public ServerResponse selectEconomicGainKey(Integer id) {
		
		return ServerResponse.createBySuccess(economicGainMapper.selectEconomicGainKey(id));
	}

	public ServerResponse updateEconomicGain(economicGain record) {
		
		return ServerResponse.createBySuccess(economicGainMapper.updateEconomicGain(record));
	}

	public economicGain selectEconomicGain(RateVo d) {
		
		return economicGainMapper.selectEconomicGain(d);
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
   public ServerResponse deleteFurtherInformation(Integer id) {
  		
		return ServerResponse.createBySuccess(furtherInformationMapper.deleteFurtherInformation(id));
	}

	public ServerResponse insertFurtherInformation(furtherInformation record) {
		
		return ServerResponse.createBySuccess(furtherInformationMapper.insertFurtherInformation(record));
	}

	public ServerResponse selectFurtherInformationKey(Integer id) {
		
		return ServerResponse.createBySuccess(furtherInformationMapper.selectFurtherInformationKey(id));
	}

	public ServerResponse updateFurtherInformation(furtherInformation record) {
		
		return ServerResponse.createBySuccess(furtherInformationMapper.updateFurtherInformation(record));
	}

	public furtherInformation selectFurtherInformation(RateVo d) {
		
		return furtherInformationMapper.selectFurtherInformation(d);
	}

	public ServerResponse selectProfitabilityList(Integer id) {
		
		return ServerResponse.createBySuccess(profitabilityMapper.selectProfitabilityList(id));
	}
	

	
	
}
